#!/usr/bin/env lua
-- Copyright (C) 2012 wgm.china@gmail.com
--init_config.lua is not OK
local cjson = require "cjson"
local config_table = ngx.shared.gcs_config   --声明ngx.shared.gcs_config
local ipshine_table = ngx.shared.gcs_ipshine   --声明ngx.shared.gcs_ipshine




local config_table_keys = config_table:get_keys()
local ipshine_table_keys = ipshine_table:get_keys()



ngx.say("<body>")
ngx.say("<html>")

---1-----------------
ngx.say("config_table_keys:"..table.getn(config_table_keys))

ngx.say("<table border='1'>")
ngx.say("<tr>")
ngx.say("<th>keys</th>")
ngx.say("<th>value</th>")
ngx.say("</tr>")
	
for i,key in pairs(config_table_keys) do
	local value = config_table:get(key)
	ngx.say("<tr>")
	ngx.say("<td>"..key.."</td>")
	ngx.say("<td>"..value.."</td>")
	ngx.say("</tr>")
end

ngx.say("</table>")

ngx.say("<P>")
----2----------------------

ngx.say("ipshine_table_keys:"..table.getn(ipshine_table_keys))

ngx.say("<table border='1'>")
ngx.say("<tr>")
ngx.say("<th>keys</th>")
ngx.say("<th>value</th>")
ngx.say("</tr>")
	
for i,key in pairs(ipshine_table_keys) do
	local value = ipshine_table:get(key)
	ngx.say("<tr>")
	ngx.say("<td>"..key.."</td>")
	ngx.say("<td>"..value.."</td>")
	ngx.say("</tr>")
end

ngx.say("</table>")
ngx.say("<P>")





ngx.say("</body>")
ngx.say("</html>")

